Trigger

53 views
Skip to first unread message

Rohit Waghchaure

unread,
Jul 5, 2013, 5:56:44 AM7/5/13
to erpnext-dev...@googlegroups.com
Hello All
                 I have fired trigger on quantity (qty) of sales order item table. When i select item from item code in sales order item it shows value 1(By default) in quantity field. when i changed value like 20, the trigger which i fired on qty is work fine. If their value is 1 (by default) and i have changed it to 1 again to call trigger that time quantity trigger does not work because already their is 1 present, But if i remove this 1,click on blank field and once again put 1 over their that time trigger is work. So can u please help me to solve this problem or tell me how can i default set 0 value to quantity when i select item from item code in sales order using client side only.

Thanks and Regards
Rohit

Anand Doshi

unread,
Jul 5, 2013, 7:55:06 AM7/5/13
to erpnext-dev...@googlegroups.com
Hi Rohit,

Please explain the problem as a list of steps. If possible, use screenshots. 

The current one is difficult to read and understand.

-Anand.

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/d2d7fe89-1bed-4cc7-8e60-73403e8fad28%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Rohit Waghchaure

unread,
Jul 5, 2013, 8:34:57 AM7/5/13
to erpnext-dev...@googlegroups.com
Hello Anand
                    I have attach snap shot whose description is as follows:
1 In first snap shot (pic 1) when i select test item qty is automatically set to 1( i want here value zero using client script only)

2 As i say i have written trigger on quantity so when i enter new quantity it fetch value and set to Item Volume and Total like Quantity=25  Item volume=12 total=300 which is correct (in 2nd pic).

3 But when i select new item (Quantity is 1 by default) for quantity 1 i need to enter 1 once again to fired trigger. So i enter 1 once again but it did not work

4 so i clear quantity and keep as blank (pic 3) it fetch value like quantity=blank Item volume=12 and Total=0

5 Now in place of blank value i have enter value 1 that time it working(pic 4)

So from above i have conclude that for integer values except 1 trigger work fine. For 1 i have to keep quantity as blank first and then enter 1 again to fired trigger. I think this is because when i select item code in sales order it keep quantity as 1 by default. So how i set zero here through client side only.

Thanks and Regards
Rohit


Pic 1.png
Pic 2.png
Pic 3.png
Pic 4.png

Rushabh Mehta

unread,
Jul 5, 2013, 8:45:13 AM7/5/13
to erpnext-dev...@googlegroups.com
Rohit,

One work around is to create a button "Update Volume" to recalculate all volumes. Also update the volumes on client side validate and server side incase the user forgets to click the button.

- Rushabh


T: @rushabh_mehta


For more options, visit https://groups.google.com/groups/opt_out.
 
 
<Pic 1.png><Pic 2.png><Pic 3.png><Pic 4.png>

Rohit Waghchaure

unread,
Jul 5, 2013, 11:35:08 PM7/5/13
to erpnext-dev...@googlegroups.com
Hi Anand
                Is it possible to set quantity to zero when item get loaded into item code of item table in sales order using client script only without looking at server side.

Thanks and Regards
Rohit


Quantity.png

Anand Doshi

unread,
Jul 8, 2013, 2:30:19 AM7/8/13
to erpnext-dev...@googlegroups.com
Hi Rohit,

Instead of setting qty as 0, you should aim for running the trigger when the Item details are fetched.

Do you pull the volume from server side using ajax or is it add fetch? How is the volume calculation done?
Without referring to the code, I can't give you any useful suggestions.

-Anand.

--
Please Note:
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 
<Quantity.png>

Reply all
Reply to author
Forward
0 new messages