Custom Field calling

167 views
Skip to first unread message

Joseph Siame

unread,
Mar 13, 2013, 2:31:40 AM3/13/13
to erpnext-dev...@googlegroups.com
Hi

I created a field called pay-rate in the Employee master to store daily pay rate. I then created another field in Attendance form to show the pay-rate (called pay_rate).

When the employee details are called into a new Attendance form i would like to be able to call the pay_rate of the selected employee automatically as well in the custom field field pay_rate.

Please assist me with this task.
Thanks

Anand Doshi

unread,
Mar 13, 2013, 3:03:14 AM3/13/13
to erpnext-dev...@googlegroups.com
Hi Joseph,

You can use add_fetch to pull field values from employee form to attendance form when employee is selected.

Section: Using add_fetch

Thanks,
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/msg/erpnext-developer-forum/-/_FIV_un4zqoJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Joseph Siame

unread,
Mar 13, 2013, 5:20:21 AM3/13/13
to erpnext-dev...@googlegroups.com
Hi

I have attached 2 images just to help describe my problem. Using the add_fetch script method I am failing because i keep getting an error.

The pay_rate is employee is a custom field that i described earlier and this this is the custom field form i would like to automatically appear when i type in the employee's name.

Any help will be greatly appreciated.

Thanks


On Wednesday, 13 March 2013 09:03:14 UTC+2, Anand Doshi wrote:
Hi Joseph,

You can use add_fetch to pull field values from employee form to attendance form when employee is selected.

Section: Using add_fetch

Thanks,
Anand.
On 13-Mar-2013, at 12:01 PM, Joseph Siame <thatdu...@gmail.com> wrote:

Hi

I created a field called pay-rate in the Employee master to store daily pay rate. I then created another field in Attendance form to show the pay-rate (called pay_rate).

When the employee details are called into a new Attendance form i would like to be able to call the pay_rate of the selected employee automatically as well in the custom field field pay_rate.

Please assist me with this task.
Thanks

--
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-forum+unsub...@googlegroups.com.
attendance.JPG
employee info.JPG

Umair Sayyed

unread,
Mar 13, 2013, 5:26:45 AM3/13/13
to erpnext-dev...@googlegroups.com
Hi Joseph,

Please provide the add_fetch script written to pull Pay Rate in Attendance form. Better if you can provide screen shot of the same.

--
Thanks and Regards,
Umair Sayyed
www.erpnext.com


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.

Joseph Siame

unread,
Mar 13, 2013, 6:06:06 AM3/13/13
to erpnext-dev...@googlegroups.com
Hi

I looked at the code one more time and got to partially work. Problem is, is that its calling the rate quite alright but it has now stopped calling the name.

i have attached to screen shots.

Thanks
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsubscr...@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/msg/erpnext-developer-forum/-/_FIV_un4zqoJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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-forum+unsub...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
client side script.bmp

Anand Doshi

unread,
Mar 13, 2013, 6:12:04 AM3/13/13
to erpnext-dev...@googlegroups.com
Hi Joseph,

If you just want to get Employee Name from Employee records, you can write another add_fetch to do that. It will club all add fetch and get the values together.

-Anand.

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.
 
 
<client side script.bmp>

thatdu...@gmail.com

unread,
Mar 13, 2013, 6:16:18 AM3/13/13
to erpnext-dev...@googlegroups.com
Hi

Oh ok. I thought bout that but why did the employee name stop auto filling when searching by employee code? 

Ok let me try your suggestion. 

Thanks. 

Anand Doshi

unread,
Mar 13, 2013, 6:18:43 AM3/13/13
to erpnext-dev...@googlegroups.com
When developing, you should keep the browser's javascript console open. If there is any error, it will point you in the right direction.

-Anand.

thatdu...@gmail.com

unread,
Mar 13, 2013, 6:26:36 AM3/13/13
to erpnext-dev...@googlegroups.com
Thanks, that seemed to work. Will make use of the console next time around. 

Thanks again. 

Joseph Siame

unread,
Mar 13, 2013, 10:24:15 AM3/13/13
to erpnext-dev...@googlegroups.com
Hi

Another query, on custom scripting. Is there a custom script that ca help me with the following scenario.

I have defined 4 item groups and i have 2 warehouses. I want a script to automatically fill in the reserve warehouse and using the value in the reserve warehouse field i would like to set either 'is purchase item' or 'is sales item' to yes/no?

Thanks
-Anand.


To post to this group, send email to erpnext-developer-forum@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/5lhiwAljP8YJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
<client side script.bmp>

--
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-forum+unsub...@googlegroups.com.
To post to this group, send email to erpnext-developer-forum@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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-forum+unsub...@googlegroups.com.
To post to this group, send email to erpnext-developer-forum@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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-forum+unsub...@googlegroups.com.
To post to this group, send email to erpnext-developer-forum@googlegroups.com.

Rushabh Mehta

unread,
Mar 14, 2013, 12:44:22 AM3/14/13
to erpnext-dev...@googlegroups.com
Joseph,

Default Reserve warehouse can be set in the Item Master.

best,
Rushabh

W: https://erpnext.com
T: @rushabh_mehta

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.

Joseph Siame

unread,
Mar 14, 2013, 4:08:22 AM3/14/13
to erpnext-dev...@googlegroups.com
Hi

Ok here is the script logic i want to implement

[logic]

if item group = finished goods or boards
    then
        Set default_warehouse to Finished goods warehouse and is_purchase_item  to no;
elseif item group = ink, paper and starch
    then
        set default_warehouse to Raw Materials Warehouse and is_sales_item to no;

[/logic]

and here is the test code i tried for starters but didnt work

[code]

cur_frm.cscript.custom_refresh = function(doc) {
    if(doc.item_group="Finished Goods") {
        doc.default_warehouse="Finished Goods Warehouse";
        doc.is_purchase_item="No";
        break;
        }
    }
[/code]

So i wanted some direction.

Thanks
-Anand.


To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/5lhiwAljP8YJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
<client side script.bmp>

--
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-forum+unsub...@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.
 
 

--
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-forum+unsub...@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.
 
 

--
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-forum+unsub...@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.
 
 

--
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-forum+unsub...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.

Nabin Hait

unread,
Mar 14, 2013, 4:28:16 AM3/14/13
to erpnext-dev...@googlegroups.com
It should be called on change of item group instead of refresh.
Please check modified code: http://pastebin.com/ETN1zcg0


Regards,
Nabin Hait

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.

thatdu...@gmail.com

unread,
Mar 14, 2013, 5:29:13 AM3/14/13
to erpnext-dev...@googlegroups.com
Ok thanks. Ill try that as soon as i can. 

One last thing. I am trying to do a stock reconciliation from the stock module. Even if i leave the valuation rate empty it gives an error and doesnt update the stock why is valuation rate needed. If i have already set the price rate and last purchase rate for the items?

Thanks. 

Nabin Hait

unread,
Mar 14, 2013, 5:50:31 AM3/14/13
to erpnext-dev...@googlegroups.com
Valuation Rate is mandatory for opening stock entry. 

System does not check last purchase rate from item master, it checks for "Stock Ledger Entry" that means, at-least one stock transaction against that item.

If any stock ledge entry exists and you did not mention valuation rate in reconciliation, system copies that rate while reconciliation.

Regards,
Nabin Hait

thatdu...@gmail.com

unread,
Mar 14, 2013, 7:41:23 AM3/14/13
to erpnext-dev...@googlegroups.com
Hi 

I made a few customizations to my item form, and now my stock main reports are all not showing. 

Could be the reason or is it something else. 

Thanks


On Mar 14, 2013, at 10:28, Nabin Hait <nabi...@gmail.com> wrote:

Nabin Hait

unread,
Mar 14, 2013, 8:48:28 AM3/14/13
to erpnext-dev...@googlegroups.com
Please check whether any error appearing in javascript console log, while running report.

What type of customization you have made in item form?

Regards,
Nabin Hait

Rushabh Mehta

unread,
Mar 14, 2013, 8:51:09 AM3/14/13
to erpnext-dev...@googlegroups.com
Joseph,

Really hard to tell since our magic eye is not working ;)

Can you see your error console if you see any clue?

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta

On 14-Mar-2013, at 5:11 PM, thatdu...@gmail.com wrote:

Joseph Siame

unread,
Mar 15, 2013, 2:19:45 AM3/15/13
to erpnext-dev...@googlegroups.com
Hi

For starters the voucher number and item code filter fields appear to be missing. Any thoughts on that because i don't remember changing anything there.

Regards,
Nabin Hait

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/8U2Afa58hmIJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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-forum+unsub...@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.
 
 

Rushabh Mehta

unread,
Mar 15, 2013, 2:34:11 AM3/15/13
to erpnext-dev...@googlegroups.com
Joseph,

On 15-Mar-2013, at 11:49 AM, Joseph Siame <thatdu...@gmail.com> wrote:

For starters the voucher number and item code filter fields appear to be missing.

From where?

Any thoughts on that because i don't remember changing anything there.

I don't have access to your account either :)

You have still not told us what you see in your javascript error log. The more information you give, the better we will be able to help you.

thanks,
Rushabh

ps. Please don't mind my occasional attempt at humour.

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.

Joseph Siame

unread,
Mar 15, 2013, 2:53:07 AM3/15/13
to erpnext-dev...@googlegroups.com
Hi

Sorry, here is a screen shot showing the errors in the console.
Joseph,

error.JPG

Rushabh Mehta

unread,
Mar 15, 2013, 5:02:14 AM3/15/13
to erpnext-dev...@googlegroups.com
Joseph, must be a syntax error in your custom script.



On 15-Mar-2013, at 12:23 PM, Joseph Siame <thatdu...@gmail.com> wrote:

Hi

Sorry, here is a screen shot showing the errors in the console.

On Friday, 15 March 2013 08:34:11 UTC+2, rushabh wrote:
Joseph,

On 15-Mar-2013, at 11:49 AM, Joseph Siame <thatdu...@gmail.com> wrote:

For starters the voucher number and item code filter fields appear to be missing.

From where?

Any thoughts on that because i don't remember changing anything there.

I don't have access to your account either :)

You have still not told us what you see in your javascript error log. The more information you give, the better we will be able to help you.

thanks,
Rushabh

ps. Please don't mind my occasional attempt at humour.


--
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.
 
 
<error.JPG>

Reply all
Reply to author
Forward
0 new messages