Home › Forums › Classic DFFS › Show notification on new form based on lookup column
- This topic has 5 replies, 2 voices, and was last updated 9 years, 2 months ago by Charlie Bell.
-
AuthorPosts
-
-
September 19, 2015 at 03:40 #8498
My situation is i have a cases list and on creating new cases a user will select a customer with drop down. Based on Value customer selected it should read a column in customer list called Service Contract if the value of this column is PO Required then show a notification that says Please note this customer requires a PO to save ticket.
SO i have my main list Cases with a lookup called Customers
I have Customers list which holds the column Service Contract this is a choice field
Ideally i would love to make the PO filed on cases required if this is true and message is displayed not sure if that would be possible.
Any help in the right direction to accomplish this would be great.. thanks..
-
September 22, 2015 at 16:40 #8514
Anyone have any luck with this???? need to use associated lookup in a rule for a few items.. anyone?????
-
September 22, 2015 at 18:31 #8521
Sorry for the delay – it seems I’m not getting all the notifications from my forum.
I have a list “Customers” with the customer name in the Title field, and a field “ServiceContract” that may contain the text “PO Required”.
Then I have a lookup form my DFFS enabled form into the “Customers” list in the Title field – pulling in the customer name.
Then I have this rule in DFFS NewForm: Customer is changed > Run these functions = customerChanged (see attached image).
In the custom js tab, I have this code:
function customerChanged(){ var sVal = $("#dffs_Customer").find("option:selected").val(), res; res = spjs_getItemByID({"listName":"Customers","id":sVal,"viewFields":["ServiceContract"]}); if(res !== null){ if(res.ServiceContract === "PO Required"){ spjs.dffs.dlgBox("This customer requires a PO.",true); } } }
Change “Customer”, “Customers” and “ServiceContract” to match your field and list name.
Please note that this code example uses “spjs.dffs.dlgBox” added in v4.350 – change this to an “alert(…)” if you use another version.
Hope this helps,
AlexanderAttachments:
-
September 23, 2015 at 02:06 #8538
Thanks a bunch it seems to be working i tried it before i upgrade and i only get the Type error when function returns true…. so thanks a bunch now i just need to upgrade the site i have a bunch of custom stuff what should i backup to be safe or should i do anything special during the upgrade i didnt see anything in the install guide so figure its kinda like the normal dffs upgrade… coming from 4.306
thanks again for the help
-
September 23, 2015 at 18:30 #8550
res = spjs_getItemByID({“listName”:”Customers”,”id”:sVal,”viewFields”:[“Service_x0020_Contract”]});
could i possible change this to lookup a list on another site????
-
September 23, 2015 at 22:14 #8552
res = spjs_getItemByID({"listName":"Accounts","listBaseUrl":"/Intranet/crm","id":sVal,"viewFields":["Contract"]});
In case anyone else needs this here is the trick for a cross site lookup column
-
-
AuthorPosts
- You must be logged in to reply to this topic.