开发者

sugarcrm contacts dropdown and javascript

I require something like this for my order creation. I have the following fields in sugarcrm

name: text field
contacts :dropdown
etc ...

I need a dropdown of contacts with the fields from primary address from contacts populated here using javascript or ajax when I select a contact from the drop down in the order edit view. It should populate all the fields from the contacts to the field listed .The c开发者_如何学Contact fields are :

Primary Address
Street: 
City:   
State:  
Postal Code:    
Country:    

Other Address
Street: 
City:   
State:  
Postal Code:    
Country:    
Copy address from left:

It should populate to :

Shipping Address Street: City:

State:

Postal Code:

Country:

Billing Address Street: City:

State:

Postal Code:

Country:

Copy address from left:

Is it possible in sugarcrm. What would be the code.


It's fairly complex, but I would make it using ajax. The following is only a suggestion, since there are several ways to implement such a change.

  • Create /custom/moduels/Quotes/MyJS.js
  • In MyJS.js make an ajax call which is executed when changing the contacts dropdown and that updates the shipping/billing info with the return values.
  • Create /custom/modules/Quotes/MyFunctions.php
  • In MyFunctions.php make the php function which is called by the ajax call. This function loads the contact's info and returns it in a JSON string
  • Create a new entrypoint for the ajax call, which points to the MyFunctions.php
  • Copy /modules/Quotes/tpl/Create/EditViewFooter.tpl to /custom/modules/Quotes/tpl/Create/EditViewFooter.tpl
  • Edit EditViewFooter.tpl and make it include MyJS.js
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜